/* 
 * File:   Z3D_Mesh.h
 * Author: ferranferri
 *
 * Created on June 6, 2013, 4:23 PM
 */

#pragma once
#ifndef Z3D_MESH_H
#define	Z3D_MESH_H

#include "core/core_utils.h"
#include "../shader/shaders.h"

namespace z3d{
    /**
     * Models a 3D structure.
     * 
     */
    class Z3D_Mesh {
        float* _vertices;
        uint32_t _nVertices;
        std::string _name;
        GLuint _vertexArrayObjectId;
        GLuint _vertexBufferObjectId;
        
    public:
        Z3D_Mesh(const std::string& name);
        
        /**
         * Set vertices for the mesh
         * @param verts 
         */
        void setVertices(const std::vector<float>& verts);
        
        bool loadTriangles(/*const Program& p*/);
              
        void draw();
        
        void setName(std::string _name) {
            this->_name = _name;
        }
        
        std::string getName() const {
            return _name;
        }
        
        float vertexAt(uint32_t idx);
        
        virtual ~Z3D_Mesh();
        GLuint getVertexBufferObjectId() const;
        GLuint getVertexArrayObjectId() const;
    private:

    };
}
#endif	/* Z3D_MESH_H */

